package com.huyiyu.dbproject.service;

import com.huyiyu.dbproject.dto.Student;
import com.huyiyu.dbproject.dto.StudentDetail;
import com.huyiyu.dbproject.dto.StudentTemp;
import com.huyiyu.dbproject.mapper.StudentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public class StudentService {
  @Autowired
  private StudentMapper studentMapper;

  public ArrayList<Student> getStudents(){return studentMapper.getStudents();}

  public ArrayList<Student> getStudentBySno(int Sno){return studentMapper.getStudentBySno(Sno);}

  public int deleteStudent(int Sno){
    return studentMapper.deleteStudent(Sno);
  }

  public ArrayList<StudentTemp> getStudentsByIntellectual(){
    return studentMapper.getStudentsByIntellectual();
  };

  public ArrayList<StudentTemp> getStudentsByCapacity(){
    return studentMapper.getStudentsByCapacity();
  };

  public int insertStudent(StudentDetail studentDetail){
    return studentMapper.insertStudent(studentDetail);
  }

  public int updateStudent(StudentDetail studentDetail){
    return studentMapper.updateStudent(studentDetail);
  }
}
